		<table class="tablelist profilelist">
	    	<thead>
				<tr>
					<td width="20" class="sectiontableheader">
						<?php echo JText::_( '#' ); ?>
					</td>
					
					<?php
					if(isset($this->fieldlist)){
						for($i = 0, $n = count($this->fieldlist); $i < $n; $i++ ){
							$field = $this->fieldlist[$i];
							$header = JText::_($field->label);
							
							?>
							<td  class="sectiontableheader">
								<?php echo  $header; ?>
							</td>
							<?php
						}
					}
	                ?>
	                
				</tr>
			</thead>
			<?php if(isset($this->all_items) && count($this->all_items)){?>
			<tbody>
	    	<?php
	    	$items = $this->all_items;
	    	
	    	$k = 0;
	    	$orderNo = 0;
	    	$currentTable = '';
	    	for($i = 0, $n = count($items); $i < $n; $i++, $orderNo++){
	    		$item = $items[$i];
	    		JFilterOutput::objectHTMLSafe( $item );
	    		if (is_numeric($item->user_id))
	    			$temp_user = JFactory::getUser($item->user_id);
	    		else 
	    		{
	    			$temp_user = new stdClass();
	    			$temp_user->username = $item->user_id;
	    		}
	    		$temp_user->username = str_replace('.','()',$temp_user->username);
	    		if ($i==0)
		      		$classname = 'first sectiontableentry'.($k+1);
		      	elseif ($i==$n-1)
		      		$classname = 'last sectiontableentry'.($k+1);
		      	else 
		      		$classname = 'sectiontableentry'.($k+1);  	    	
	    		?>
	    		<tr class="<?php echo $classname; ?>">
	        		<td align="center" <?php echo ($item->featured==1)?'class="first hot"':'class="first"';?>>
		       			<?php echo $i+1; ?>
		       		</td>
	        		
	        		
	        		<?php
					
	                for($ii = 0, $nn = count($this->fieldlist); $ii < $nn; $ii++ ){
	                	$td_classname = '';
	                	if($item->featured==1) $td_classname = ' hot ';
	                	if ($ii==$nn-1)
	                		$td_classname .= 'last';
	                   	$field = $this->fieldlist[$ii];
                        $field_name = $field->field_name;
                        
	                	$text = $field->truncate_length?SmartTrim::trim($item->$field_name,0,$field->truncate_length):$item->$field_name;
	                	$text = $field->clean_format?JFilterOutput::cleanText($text):$text;
	                	if ($field->field_type=='URL'&&!$field->linked)
	                	{
		                	if (substr($item->$field_name,0,7)!='http://')
		                		$value_link = 'http://'.$item->$field_name;
		                	else 
		                		$value_link = $item->$field_name;
		                	$text = '<a href="'.$value_link.'" target="_blank">'.$text.'</a>';
		                }
	                	
	                	$width_column = ($field->column_width!=0)?"width=\"".$field->column_width."%\"":"";
	                   	//$nowrap = $field->no_wrap ? "nowrap=\"nowrap\"":"";	   
			    		$align="";                        
		                		    
			    		if($field->field_type == "boolean" ){
                            $align = "align='center'";
                            $text = $this->getToggleLink($field_name, $item);
                        }
                                          
	                    if($field->linked){?>
	                    	<?php $alias = JFilterOutput::stringURLSafe($item->$field_name); ?>
	                        <td <?php echo $align; ?> <?php //echo $nowrap; ?> <?php echo $width_column; ?> class="<?php echo $td_classname; ?>" >	  
	                        <?php if ($field->is_bold) echo '<strong>'; ?>                      	
                                <a href="<?php echo JRoute::_( 'index.php?option='. JBCOMNAME .'&view=japrofiles&layout=jaview&cid[]='.$temp_user->username); ?>"  ><?php echo $text; ?></a>
                            <?php if ($field->is_bold) echo '</strong>'; ?>
	                        </td>
	                        <?php
	                    } else {
	                        ?>
	                        <td <?php echo $align; ?> <?php //echo $nowrap; ?> <?php echo $width_column; ?> class="<?php echo $td_classname; ?>" >
	                        <?php if ($field->is_bold) echo '<strong>'; ?>
	                            <?php echo  $text; ?>
	                        <?php if ($field->is_bold) echo '</strong>'; ?>
	                        </td>
	                        <?php
	                    }
	                }
	                ?>
	               
	        	</tr>
	    	<?php
	    		$k = 1 - $k;
			}
	    	?>
	    	
	    	</tbody>
	    	<?php }?>
	    	
		</table>
		<input type="hidden" name="filter_order" id="filter_order" value="" />
		<input type="hidden" name="filter_order_Dir" id="filter_order_Dir" value="" />
		<input type="hidden" id="view" name="view" value="profiles" />